package com.zhuangjie.order.controller;


import com.zhaungjie.base.conduit.R;
import com.zhuangjie.base.constant.ModuleSecurityNames;
import com.zhuangjie.order.pojo.DeliveryInfoForRider;
import com.zhuangjie.order.service.DeliveryInfoService;
import com.zhuangjie.security.annotations.PublicAPI;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  配置信息
 * </p>
 *
 * @author zhuangjie
 * @since 2023-11-24
 */
@RestController
@RequestMapping("/delivery-info")
public class DeliveryInfoController {
    @Autowired
    private DeliveryInfoService deliveryInfoService;

    @GetMapping("/query-for-create-delivery-order/{orderId}")
    @ApiOperation("查询订单创建配送单需要的数据")
    @PublicAPI(modules = {ModuleSecurityNames.SHOP})
    public R queryForCreateDeliveryOrder(@PathVariable("orderId") Long orderId){
        return R.require(DeliveryInfoForRider.class, deliveryInfoService.queryForCreateDeliveryOrder(orderId));
    }
}

